package com.zzyl.nursing.job;

import com.zzyl.common.utils.SecurityUtils;
import com.zzyl.nursing.service.IReservationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 预约过期定时任务
 * 
 * @author zzyl
 */
@Component("reservationExpireJob")
public class ReservationExpireJob
{
    private static final Logger log = LoggerFactory.getLogger(ReservationExpireJob.class);

    @Autowired
    private IReservationService reservationService;

    /**
     * 更新过期预约状态
     */
    public void updateExpiredReservations()
    {
        try
        {
            log.info("开始执行预约过期定时任务");
            int count = reservationService.updateExpiredReservations();
            log.info("预约过期定时任务执行完成，更新了{}条记录", count);
        }
        catch (Exception e)
        {
            log.error("预约过期定时任务执行失败", e);
        }
    }
} 